all: pngtest zlibtest main Bar.class
runall: main_run pngtest_run Bar.class_run
	python matt.py
	perl hello.pl

CXX = ubig++
ifndef $(UBIQIS_CACHE_DIR)
CACHE_DIR = /var/cache/ubiqis
else
CACHE_DIR = $(UBIQIS_CACHE_DIR)
endif

pngtest: pngtest.cpp
	$(CXX) -o pngtest pngtest.cpp
pngtest_run: pngtest
	./pngtest

zlibtest: zlibtest.cpp
	$(CXX) -o zlibtest zlibtest.cpp
zlibtest_run: zlibtest
	./zlibtest

main: main.cpp
	$(CXX) -o main main.cpp
main_run: main
	./main

Bar.class: Bar.java
	$(JAVA_HOME)/bin/javac Bar.java
Bar.class_run: Bar.class
	$(JAVA_HOME)/bin/java Bar

clean:
	rm -f *.class *.o main zlibtest pngtest foo.gz pngout.png

cclean:
	sudo rm -fr $(CACHE_DIR)/*

cleanall: clean cclean

listu:
	find $(CACHE_DIR) -print
